tests: Fix negative check for transient etc
authorColin Walters <walters@verbum.org>
Tue, 22 Jul 2025 20:55:09 +0000 (16:55 -0400)
committerColin Walters <walters@verbum.org>
Tue, 22 Jul 2025 20:55:09 +0000 (16:55 -0400)
This test was passing for the wrong reason. Just noticed when
reviewing.

tests-unit-container/test-prepare-root.sh

index 466139a04d9190fe503bcd7db8e543e33acee085..d3ad3431fcd6dd4ed4e6685c0134d52a36db42d7 100755 (executable)
@@ -53,8 +53,9 @@ test -f /run/ostree-booted
 for d in etc usr; do
        mountpoint /target-sysroot/${d}
 done
-# Not transient by default
-test $(findmnt -no FSTYPE /target-sysroot/etc) '!=' tmpfs
+# etc is not transient by default
+etc_options=$(findmnt -no OPTIONS /target-sysroot/etc)
+[[ ! $etc_options =~ "upperdir=/run/ostree/transient-etc" ]]
 
 # Default is ro in our images
 grep -q 'readonly.*true' /usr/lib/ostree/prepare-root.conf